package tjs.org.springLoader.config;

import org.springframework.context.ApplicationContext;
import tjs.org.springLoader.reloader.IReloader;

import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * Created by Nicky.Tang on 2021/9/29 5:39 下午
 *
 * @since 02.12.10
 */
public class DoAutoReloader {
    private ApplicationContext applicationContext;
    private AutoReloaderProperties autoReloaderProperties;
    private List<IReloader> reloaders;

    public DoAutoReloader(ApplicationContext applicationContext, AutoReloaderProperties autoReloaderProperties) {
        this.applicationContext = applicationContext;
        this.autoReloaderProperties = autoReloaderProperties;
        this.reloaders = applicationContext.getBeansOfType(IReloader.class).entrySet().stream().map(Map.Entry::getValue).collect(Collectors.toList());
    }

    public void doAutoReloader() {

    }


    public ApplicationContext getApplicationContext() {
        return applicationContext;
    }

    public AutoReloaderProperties getAutoReloaderProperties() {
        return autoReloaderProperties;
    }

    public List<IReloader> getReloaders() {
        return reloaders;
    }
}
